package com.sunday.common.dubbo.tools.provider.impl;

import com.sunday.common.core.remoting.base.response.Response;
import com.sunday.common.dubbo.tools.provider.Provider;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;

@Slf4j
//@DubboService(timeout = 6000, retries = 2)
//@DubboService(registry = "test1")
@DubboService
public class ProviderImpl implements Provider {

    public Response save(String name) {
        log.info("{}", name);
        new Thread(() -> log.info("{}", name)).start();
        throw new RuntimeException("就是想报一个错");
//        try {
//            TimeUnit.SECONDS.sleep(60);
//        } catch (Exception e) {
//            throw new RuntimeException(e);
//        }
//        return Response.ok();
    }

}